<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/12/18 0018
 * Time: 8:26
 */

namespace app\admin\model;

use think\Db;
class Kczs extends My_model
{

    /**
     * @param $param 获取章节列表
     */
    public function getCourseList($param){
        $kcid      = Db::name('kcb')->where([ 'no' => myEcho($param['no'] , 0) ])->limit(1)->value('kcid' , '');

        $where     = $kcid ? [ 'ofkc' => $kcid ] : 'ofkc is null';

        $return    = Db::name('ksb')->field([ 'ksname' , 'href' ])->where($where)->select();

        return $return;
    }

public function getKczs(){
  return  $this->select();
}

public function getKc($no){
    return $this->where(['no'=>$no])->find();
}

public function getcx($name){
    return $this->where(['name'=>$name])->find();
}
}